package com.example.classloader;

import java.lang.reflect.Method;

public class ClassLoaderTest {


    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws Exception {
        String classPath = "D:\\JavaWorkSpace\\leetcode\\target\\classes\\com\\wkr\\leetcode\\Test.class";
        CustomClassLoader customClassLoader = new CustomClassLoader(classPath);
        Class main  = Class.forName("com.wkr.leetcode.Test", true, customClassLoader);
        Method method = main.getDeclaredMethod("main", String[].class);
        method.invoke(main.newInstance(), (Object) new String[] {});
    }
}
